package logic

import (
	"context"
	"shape-erver/utils"

	"shape-erver/internal/svc"
	"shape-erver/internal/types"

	"github.com/tal-tech/go-zero/core/logx"
)

type AddTaskCancelLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewAddTaskCancelLogic(ctx context.Context, svcCtx *svc.ServiceContext) AddTaskCancelLogic {
	return AddTaskCancelLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *AddTaskCancelLogic) AddTaskCancel(req types.AddTaskCancelReq) (*types.AddTaskCancelResp, error) {
	// todo: add your logic here and delete this line
	utils.SetTaskGuidToRedis(req.TaskId, utils.CANCEL)
	return &types.AddTaskCancelResp{IsCanceled: true}, nil
}
